package java8;

public class FunctionTest1 {
    public static void main(String[] args) {
        String s = "123";
        test(FunctionTest1::print, s); // 不需要@functionalInterface也可以写lambda
    }

    public static <T> void test(FunctionTest1_i1<T> f, T t) {
        f.fun(t);
    }

    public static void print(String s) {
        System.out.println(s);
    }
}

interface FunctionTest1_i1<T> {
    void fun(T t);
}
